import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:geomancy/providers/user_provider.dart';
import 'package:geomancy/styles/index.dart';
import 'package:geomancy/tools/constant.dart';
import 'package:geomancy/widgets/common_header.dart';
import 'package:geomancy/widgets/common_text.dart';
import 'package:geomancy/widgets/common_title.dart';
import 'package:provider/provider.dart';

class SettingAccountSafePage extends StatefulWidget {
  const SettingAccountSafePage({super.key});

  @override
  State<SettingAccountSafePage> createState() => _SettingAccountSafePageState();
}

class _SettingAccountSafePageState extends State<SettingAccountSafePage> {
  @override
  Widget build(BuildContext context) {
    final user = context.watch<UserProvider>().getUserInfo;
    return Scaffold(
      appBar: CommonHeader.appBar(context: context),
      backgroundColor: ColorStyle.pageDefaultColor,
      body: ListView(
        physics: const ClampingScrollPhysics(),
        padding: EdgeInsets.fromLTRB(Constant.PAGEPADDING.w, 20.w, Constant.PAGEPADDING.w, 40.w),
        children: [
          const CommonTitleWidget(txt: '账号安全'),
          Container(
            height: 830.w,
            margin: EdgeInsets.only(top: 20.w),
            padding: EdgeInsets.only(bottom: 140.w, left: 40.w, right: 40.w),
            decoration: BoxDecoration(
                color: ColorStyle.themeLightColor,
                border: Border.all(width: 5.w, color: ColorStyle.borderColor),
                borderRadius: BorderRadius.all(Radius.circular(60.w))
            ),
            child: Column(
              children: [
                Container(
                  height: 100.w,
                  alignment: Alignment.bottomLeft,
                  padding: EdgeInsets.only(bottom: 12.w),
                  decoration: BoxDecoration(
                    border: Border(
                      bottom: BorderSide(width: 2.w, color: ColorStyle.borderColor)
                    ),
                  ),
                  child: Row(
                    children: [
                      const Expanded(child: CommonText(txt: '手机号')),
                      CommonText(txt: user?.phone ?? ''),
                      SizedBox(width: 10.w),
                      Image.asset('assets/icons/icon_arrow_right.png', width: 10.w)
                    ],
                  ),
                )
              ],
            ),
          ),
        ],
      ),
    );
  }
}
